package com.wxmblog.photo.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.wxmblog.base.common.utils.PageResult;
import com.wxmblog.photo.common.rest.request.product.admin.EditProductRequest;
import com.wxmblog.photo.common.rest.request.product.admin.ProductAdminRequest;
import com.wxmblog.photo.common.rest.request.product.front.ProductIndexRequest;
import com.wxmblog.photo.common.rest.response.product.admin.ProductResponse;
import com.wxmblog.photo.common.rest.response.product.front.ProductIndexResponse;
import com.wxmblog.photo.entity.ProductEntity;
import org.springframework.scheduling.annotation.Async;

import java.util.List;


/**
 * 备注
 *
 * @author wanglei
 * @email 378526425@qq.com
 * @date 2023-06-20 15:24:40
 */
public interface ProductService extends IService<ProductEntity> {

    void editProduct(EditProductRequest request);

    Long countByCategoryId(Integer categoryId);

    PageResult<ProductResponse> page(ProductAdminRequest request, Integer pageIndex, Integer pageSize);

    ProductResponse info(Integer id);

    void delete(Integer id);

    PageResult<ProductIndexResponse> frontPage(ProductIndexRequest request, Integer pageIndex, Integer pageSize);

    List<ProductIndexResponse> recommend(ProductIndexRequest request);

    void collect(Integer id, Boolean result);

    @Async
    void view(Integer id,Integer userId);

    PageResult<ProductIndexResponse> downloadRecord(Integer pageIndex, Integer pageSize);

    PageResult<ProductIndexResponse> collectRecord(Integer pageIndex, Integer pageSize);

    PageResult<ProductIndexResponse> viewRecord(Integer pageIndex, Integer pageSize);
}

